const mongoose = require('../connect');
const moment = require('moment')

let noteSchema = new mongoose.Schema({
    title:{
        type:String,
        required:true
    },
    content:{
        type:String,
        required:true,
    },
    createtime:{
        type:String,
        // 2023-05-29 09:12:32
        default:()=>moment().format('YYYY-MM-DD HH:mm:ss')
    },
    author:{
        type:String
    }
})

let noteModel = mongoose.model('notes',noteSchema);

module.exports = noteModel;